Semantics - Directed Compilation of Non - Linear Patterns 1 Olivier
نویسنده
چکیده
This paper describes the automatic derivation of compiled patterns and of a pattern compiler by partial evaluation. Compiling a pattern is achieved by specializing a pattern matching program with respect to the pattern. Generating a pattern compiler is achieved by specializing the specializer with respect to the pattern matching program, i.e., by self-applying the partial evaluator. The compiled patterns and the compiler are semantics-based because they are obtained using meaning-preserving transformations upon the de nitional pattern matching program and the partial evaluator. The results are unexpectedly good: not only all are the operations depending on the pattern (syntax analysis, resolution of cross-references due to the non-linearity) performed at compile time, but whereas the general pattern matcher builds the substitution environment incrementally and for nothing in case of failure, compiled patterns perform all the structural and equality tests rst, and build the result only if the match succeeds. This non trivial runtime staging has been obtained automatically, which is remarkable because staging in general is known to be an art. This example stresses continuation-passing style as a convenient style for writing general programs. This style makes it possible to circumvent the approximations of binding time analysis (which is an essential requirement for e cient self-application), and in addition, to stage residual programs automatically. These observations have been con rmed by later experiments.
منابع مشابه
Êùò¹ììññ Ó Òòööøøóò Óö
This Ph.D. progress report documents a combination of partial evaluation and compilation that enables “just-in-time program specialization”. To this end, we have composed a type-directed partial evaluator for OCaml programs with a run-time code generator for the OCaml virtual machine. The composition is deforested, i.e., residual programs are directly expressed as byte code, which is then dynam...
متن کاملOn the Relation of Interaction Semantics to Continuations and Defunctionalization
In game semantics and related approaches to programming language semantics, programs are modelled by interaction dialogues. Such models have recently been used in the design of new compilation methods, e.g. for hardware synthesis or for programming with sublinear space. This paper relates such semantically motivated non-standard compilation methods to more standard techniques in the compilation...
متن کاملWhich is effective: self-directed learning or tutor-directed learning on the level of nursing skills
Introduction. This is quasi experimental research in order to determine and compare the learning level of nursing skills ( in B.A students) with self-directed learning and tutor-directed learning pattern in Shaheed Beheshti Univeristy of Medical Sciences and Health Services, Nursing and Midwifery faculty, 1998-1999. Methods. First of all, a questionnaire composed of some demographic data such ...
متن کاملThe Effects of Plot Shape and Size on Determining the Distribution Pattern of Astragalus verus Olivier
The distribution pattern of plants is an important characteristic of plant communities, being of critical importance in ecological studies and sampling plans. This study was designed to investigate the efficiency of different shapes and sizes of quadrants to delineate the spatial patterns of Astragalus verus Olivier by using dispersion indices. At Mayan Rangeland (Khorasan Razavi), a digital ca...
متن کاملApplication of Linear and Non-linear Programming Model to Assess the Sustainability of Water Resources in Agricultural Patterns
Water resources sustainability is one of the major issues in the agricultural sustainability. In this study sustainability of water resources has been investigated by use of linear and non-linear models in six models based on optimal utilization of water resources in the north parts farms of Iran because of incorrect use of agricultural water resources, from 2011 to 2012. Also “gross margin per...
متن کامل